package istar.impl;

import java.util.Iterator;

import istar.IActor;
import istar.IElement;
import istar.IistarBehaviour;
import istar.agent.IstarJadeAgent;
import jade.core.behaviours.Behaviour;

public abstract class AbstractMainGoal extends Goal /*implements IBasicElement */{

	boolean deliberateCondition = false;
	
	public AbstractMainGoal(String name, IstarJadeAgent owner) {
		super(name, owner);
	}

	public AbstractMainGoal(String name) {
		super(name);
	}
	
	public boolean deliberateCondition() {
		// TODO Auto-generated method stub
		return deliberateCondition;
	}
	
	@Override
	public Object clone(IActor newOwner) throws CloneNotSupportedException {
		AbstractMainGoal newClone = (AbstractMainGoal)super.clone(newOwner);
		return newClone;
	}

	
	public abstract Behaviour getMainBehaviour();

	public void deliberate(){
		this.deliberateCondition = true;
	}
	
	public void undeliberate(){
		this.deliberateCondition = false;
	}

	public long getEstimatedTotalTime(){
		return  ((IistarBehaviour)getMainBehaviour()).getEstimatedWaitingTime();
	}
}
